<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AI快速访问 - 家族树</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.8/dist/chart.umd.min.js"></script>
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#3B82F6',
                        secondary: '#10B981',
                        accent: '#8B5CF6',
                        dark: '#1E293B',
                        light: '#F8FAFC'
                    },
                    fontFamily: {
                        sans: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .text-shadow {
                text-shadow: 0 2px 4px rgba(0,0,0,0.1);
            }
            .transition-custom {
                transition: all 0.3s ease;
            }
            .card-hover {
                @apply hover:shadow-lg hover:-translate-y-1 transition-all duration-300;
            }
            .nav-link {
                @apply relative px-3 py-2 text-gray-700 hover:text-primary transition-colors duration-200;
            }
            .nav-link::after {
                @apply content-[''] absolute bottom-0 left-0 w-0 h-0.5 bg-primary transition-all duration-200;
            }
            .nav-link:hover::after {
                @apply w-full;
            }
        }
    </style>
</head>
<body class="bg-gray-50 font-sans text-gray-800 min-h-screen flex flex-col">
    <!-- 顶部导航栏 -->
    <header class="sticky top-0 z-50 bg-white shadow-sm transition-all duration-300" id="navbar">
        <div class="container mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between items-center h-16">
                <div class="flex items-center">
                    <a href="index.html" class="flex items-center">
                        <i class="fa fa-sitemap text-primary text-2xl mr-2"></i>
                        <span class="font-bold text-xl text-dark">家族树</span>
                    </a>
                </div>
                
                <!-- 桌面导航 -->
                <nav class="hidden md:flex space-x-8">
                    <a href="index.html" class="nav-link">首页</a>
                    <a href="library.html" class="nav-link">家族资料库</a>
                    <a href="ai-access.html" class="nav-link text-primary border-b-2 border-primary">AI快速访问</a>
                    <a href="honors.html" class="nav-link">家族荣誉榜</a>
                    <a href="disgraces.html" class="nav-link">家族耻辱榜</a>
                </nav>
                
                <!-- 移动端菜单按钮 -->
                <div class="md:hidden">
                    <button id="menu-toggle" class="text-gray-700 hover:text-primary focus:outline-none">
                        <i class="fa fa-bars text-xl"></i>
                    </button>
                </div>
            </div>
        </div>
        
        <!-- 移动端导航菜单 -->
        <div id="mobile-menu" class="hidden md:hidden bg-white shadow-md absolute w-full">
            <div class="px-4 py-3 space-y-2">
                <a href="index.html" class="block px-3 py-2 text-gray-700 hover:bg-gray-100 rounded-md">首页</a>
                <a href="library.html" class="block px-3 py-2 text-gray-700 hover:bg-gray-100 rounded-md">家族资料库</a>
                <a href="ai-access.html" class="block px-3 py-2 text-primary bg-blue-50 rounded-md">AI快速访问</a>
                <a href="honors.html" class="block px-3 py-2 text-gray-700 hover:bg-gray-100 rounded-md">家族荣誉榜</a>
                <a href="disgraces.html" class="block px-3 py-2 text-gray-700 hover:bg-gray-100 rounded-md">家族耻辱榜</a>
            </div>
        </div>
    </header>

    <main class="flex-grow">
        <!-- 页面标题 -->
        <section class="bg-gradient-to-r from-accent to-primary text-white py-12">
            <div class="container mx-auto px-4 sm:px-6 lg:px-8">
                <h1 class="text-3xl sm:text-4xl font-bold text-center mb-2 text-shadow">AI快速访问</h1>
                <p class="text-center opacity-90 max-w-2xl mx-auto">利用人工智能技术探索和分析您的家族历史，发现隐藏的联系和故事。</p>
            </div>
        </section>

        <!-- AI功能区域 -->
        <section class="py-12">
            <div class="container mx-auto px-4 sm:px-6 lg:px-8">
                <!-- AI搜索框 -->
                <div class="max-w-2xl mx-auto mb-12">
                    <div class="relative">
                        <input type="text" id="ai-search-input" placeholder="向AI提问... 例如: 查找1950年出生的家族成员" class="w-full px-4 py-4 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent text-lg pl-12">
                        <i class="fa fa-search absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 text-xl"></i>
                        <button id="ai-search-btn" class="absolute right-2 top-1/2 transform -translate-y-1/2 bg-primary text-white px-4 py-2 rounded-lg hover:bg-primary/90 transition-colors">
                            提问
                        </button>
                    </div>
                </div>

                <!-- AI功能卡片 -->
                <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 mb-12">
                    <!-- 功能1: 家族关系分析 -->
                    <div class="bg-white rounded-lg shadow-md p-6 card-hover" id="relation-analysis">
                        <div class="w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center text-primary mb-6 mx-auto">
                            <i class="fa fa-sitemap text-2xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-center mb-3">家族关系分析</h3>
                        <p class="text-gray-600 text-center mb-6">智能分析家族成员之间的复杂关系，生成可视化图谱。</p>
                        <button class="w-full py-3 bg-primary text-white rounded-lg font-medium hover:bg-primary/90 transition-colors">
                            开始分析
                        </button>
                    </div>

                    <!-- 功能2: 历史事件关联 -->
                    <div class="bg-white rounded-lg shadow-md p-6 card-hover" id="event-correlation">
                        <div class="w-16 h-16 rounded-full bg-secondary/10 flex items-center justify-center text-secondary mb-6 mx-auto">
                            <i class="fa fa-history text-2xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-center mb-3">历史事件关联</h3>
                        <p class="text-gray-600 text-center mb-6">将家族成员的重要事件与历史背景相结合，深入了解家族故事。</p>
                        <button class="w-full py-3 bg-secondary text-white rounded-lg font-medium hover:bg-secondary/90 transition-colors">
                            探索历史
                        </button>
                    </div>

                    <!-- 功能3: 智能记录生成 -->
                    <div class="bg-white rounded-lg shadow-md p-6 card-hover" id="intelligent-record">
                        <div class="w-16 h-16 rounded-full bg-accent/10 flex items-center justify-center text-accent mb-6 mx-auto">
                            <i class="fa fa-magic text-2xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-center mb-3">智能记录生成</h3>
                        <p class="text-gray-600 text-center mb-6">根据现有资料自动生成家族成员传记和重要事件记录。</p>
                        <button class="w-full py-3 bg-accent text-white rounded-lg font-medium hover:bg-accent/90 transition-colors">
                            生成记录
                        </button>
                    </div>
                </div>

                <!-- AI分析结果 -->
                <div id="ai-result" class="bg-white rounded-lg shadow-md p-6 hidden">
                    <h3 class="text-xl font-bold mb-4 flex items-center">
                        <i class="fa fa-robot text-primary mr-2"></i> AI分析结果
                    </h3>
                    <div id="ai-result-content" class="text-gray-700">
                        <!-- 结果内容将在这里动态显示 -->
                    </div>
                </div>
            </div>
        </section>
    </main>

    <!-- 页脚 -->
    <footer class="bg-dark text-white py-12">
        <div class="container mx-auto px-4 sm:px-6 lg:px-8">
            <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
                <div>
                    <h3 class="text-lg font-bold mb-4 flex items-center">
                        <i class="fa fa-sitemap text-primary mr-2"></i> 家族树
                    </h3>
                    <p class="text-gray-400 text-sm">连接过去，现在和未来，构建完整的家族历史图谱。</p>
                </div>
                <div>
                    <h4 class="font-bold mb-4">功能导航</h4>
                    <ul class="space-y-2 text-gray-400 text-sm">
                        <li><a href="index.html" class="hover:text-primary transition-colors">首页</a></li>
                        <li><a href="library.html" class="hover:text-primary transition-colors">家族资料库</a></li>
                        <li><a href="ai-access.html" class="hover:text-primary transition-colors">AI快速访问</a></li>
                        <li><a href="honors.html" class="hover:text-primary transition-colors">家族荣誉榜</a></li>
                        <li><a href="disgraces.html" class="hover:text-primary transition-colors">家族耻辱榜</a></li>
                    </ul>
                </div>
                <div>
                    <h4 class="font-bold mb-4">帮助中心</h4>
                    <ul class="space-y-2 text-gray-400 text-sm">
                        <li><a href="#" class="hover:text-primary transition-colors">使用指南</a></li>
                        <li><a href="#" class="hover:text-primary transition-colors">常见问题</a></li>
                        <li><a href="#" class="hover:text-primary transition-colors">联系支持</a></li>
                    </ul>
                </div>
                <div>
                    <h4 class="font-bold mb-4">联系我们</h4>
                    <ul class="space-y-2 text-gray-400 text-sm">
                        <li class="flex items-center"><i class="fa fa-envelope-o mr-2"></i> support@familytree.com</li>
                        <li class="flex items-center"><i class="fa fa-phone mr-2"></i> +86 123 4567 8910</li>
                    </ul>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-500 text-sm">
                <p>&copy; 2023 家族树应用. 保留所有权利.</p>
            </div>
        </div>
    </footer>

    <!-- JavaScript -->
    <script>
        // 移动端菜单切换
        document.getElementById('menu-toggle').addEventListener('click', function() {
            const mobileMenu = document.getElementById('mobile-menu');
            mobileMenu.classList.toggle('hidden');
        });

        // 导航栏滚动效果
        window.addEventListener('scroll', function() {
            const navbar = document.getElementById('navbar');
            if (window.scrollY > 10) {
                navbar.classList.add('shadow-md');
                navbar.classList.remove('shadow-sm');
            } else {
                navbar.classList.remove('shadow-md');
                navbar.classList.add('shadow-sm');
            }
        });

        // 平滑滚动
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();
                document.querySelector(this.getAttribute('href')).scrollIntoView({
                    behavior: 'smooth'
                });
            });
        });

        // AI搜索功能
        document.getElementById('ai-search-btn').addEventListener('click', function() {
            const input = document.getElementById('ai-search-input').value;
            if (!input.trim()) {
                alert('请输入您的问题');
                return;
            }
            // 显示加载状态
            document.getElementById('ai-result').classList.remove('hidden');
            document.getElementById('ai-result-content').innerHTML = '<div class="flex justify-center py-8"><div class="animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-primary"></div></div>';

            // 模拟AI处理延迟
            setTimeout(() => {
                // 显示模拟结果
                const resultContent = `
                    <p class="mb-4">感谢您的提问: <strong>${input}</strong></p>
                    <p class="mb-4">AI正在分析您的问题并检索相关家族数据...</p>
                    <p>AI功能即将上线，敬请期待！</p>
                `;
                document.getElementById('ai-result-content').innerHTML = resultContent;
            }, 1500);
        });

        // AI功能按钮点击事件
        document.getElementById('relation-analysis').querySelector('button').addEventListener('click', function() {
            alert('家族关系分析功能即将上线，敬请期待！');
        });

        document.getElementById('event-correlation').querySelector('button').addEventListener('click', function() {
            alert('历史事件关联功能即将上线，敬请期待！');
        });

        document.getElementById('intelligent-record').querySelector('button').addEventListener('click', function() {
            alert('智能记录生成功能即将上线，敬请期待！');
        });
    </script>
</body>
</html>